import request from "@/utils/request";
import { SearchProductType, SearchProdureType } from "./type";

//显示产品
export const GetProductPage = (params: SearchProductType) => {
  return request({
    url: "/Product/ShowProduct",
    method: "get",
    params,
  });
};

//添加
export const InsertProcure = (data: any) => {
  return request({
    url: "/ProcurementServices/AddProcurement",
    method: "post",
    data,
  });
};

//显示采购
export const ShowProcure = (params: SearchProdureType) => {
  return request({
    url: "/ProcurementServices/ShowProcurement",
    method: "get",
    params,
  });
};

//枚举转下拉框
export const ShowProcurementState = () => {
  return request({
    url: "/ProcurementServices/ShowProcurementState",
    method: "get",
  });
};

//删除
export const DelProcure = (params: any) => {
  return request({
    url: "/ProcurementServices/DelProcurement?id=" + params,
    method: "delete",
  });
};

//返回对应的信息
export const EmitProcureManage = (params: any) => {
  return request({
    url: "/ProcurementServices/BackFillProcurement?id=" + params,
    method: "get",
  });
};

//返回对应的信息
export const EmitShopping = (params: any) => {
  return request({
    url: "/ProcurementServices/BackFillShopping?code=" + params,
    method: "get",
  });
};

//修改
export const UpdDateProcure = (data: any) => {
  return request({
    url: "/ProcurementServices/ShowProcurement",
    method: "put",
    data,
  });
};

//枚举转下拉框
export const GetDocumentState = () => {
  return request({
    url: "/ProcurementServices/ShowProcurement",
    method: "get",
  });
};

//返回对应的信息
export const EmitShopping1 = (params: any) => {
  return request({
    url: "/ProcurementServices/ShowProcurement?id=" + params,
    method: "get",
  });
};

//添加
export const InsertProcuremenReturn = (data: any) => {
  return request({
    url: "/ProcurementServices/ShowProcurement",
    method: "post",
    data,
  });
};
